package com.bookstore.factory;

import com.bookstore.service.ProductService;
import com.bookstore.service.UserService;
import com.bookstore.service.impl.ProductServiceImpl;
import com.bookstore.service.impl.UserServiceImpl;
public class ServiceFactory {
    private static UserService userService;
    private static ProductService productService;

    private ServiceFactory() {
    }

    public static UserService getUserService() {
        if (userService==null){
            return new UserServiceImpl();
        }
        return userService;
    }

    public static ProductService getProductService() {
        if (productService==null){
            return new ProductServiceImpl();
        }
        return productService;
    }
}
